
$(function() {

	var slideshowGallery = new BertaTemplate.SlideshowGallery($('.article-gallery'), {
		autoPlay: false
	});

	if(window.Berta && Berta.Controller) {
		var onBeforeEditableReload = function(oldEl, newEl) {
			if($(oldEl).hasClass('article-gallery')) {
				slideshowGallery.remove(oldEl);
			}
		};
		var onAfterEditableReload = function(oldEl, newEl) {
			if($(newEl).hasClass('article-gallery')) {
				slideshowGallery.add(newEl);
			}
		};

		Berta.Controller.addEvent('beforeEditableReload', onBeforeEditableReload);
		Berta.Controller.addEvent('afterEditableReload', onAfterEditableReload);


		







	}






});

